<!DOCTYPE html>
<head>
	<title>登录</title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	
	<link href="__PUBLIC__/css/font-awesome.min.css" rel="stylesheet" type="text/css">
	<link href="__PUBLIC__/Dist/css/bootstrap.min.css" rel="stylesheet" type="text/css">
	<link href="__PUBLIC__/Dist/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
	<link href="__PUBLIC__/Home/css/templatemo_style.css" rel="stylesheet" type="text/css">

	<script src="__PUBLIC__/js/function.js"></script>
	<script src="__PUBLIC__/Dist/js/jquery.min.js"></script>
	<script src="__PUBLIC__/Dist/js/bootstrap.min.js"></script>
</head>
<body class="templatemo-bg-gray">
	<div class="container">
		<div class="col-md-12">
			<h1 class="margin-bottom-15">Login Form One</h1>
			<form id="login-form" class="form-horizontal templatemo-container templatemo-login-form-1 margin-bottom-30" role="form" action="<{:U('login')}>" method="post">
		        <div class="form-group">
		          <div class="col-xs-12">		            
		            <div class="control-wrapper">
		            	<label for="username" class="control-label fa-label"><i class="fa fa-user fa-medium"></i></label>
		            	<input type="text" class="form-control" name="name" id="username" placeholder="用户名">
		            </div>		            	            
		          </div>              
		        </div>
		        <div class="form-group">
		          <div class="col-md-12">
		          	<div class="control-wrapper">
		            	<label for="password" class="control-label fa-label"><i class="fa fa-lock fa-medium"></i></label>
		            	<input type="password" class="form-control" name="password" id="password" placeholder="密码">
		            </div>
		          </div>
		        </div>
		        <div class="form-group">
		          <div class="col-md-12">
	             	<div class="checkbox control-wrapper">
	                	<label>
	                  		<input type="checkbox"> 记住密码
                		</label>
	              	</div>
		          </div>
		        </div>
		        <div class="form-group">
		          <div class="col-md-12">
		          	<div class="control-wrapper">
		          		<input type="submit" value="登录" class="btn btn-info">
		          		<a href="M<{:U('foget')}>" class="text-right pull-right">忘记密码?</a>
		          	</div>
		          </div>
		        </div>
		        <hr>
		        <div class="form-group">
		        	<div class="col-md-12">
		        		<label>Login with: </label>
		        		<div class="inline-block">
		        			<a href="#" onclick = "toLogin()"><i class="fa fa-facebook-square login-with"><img
									src="__PUBLIC__/Home/image/Connect_logo_7.png" alt="QQ登录"></i></a>
		        		</div>
						<script>
//							function toLogin()
//							{
//								//以下为按钮点击事件的逻辑。注意这里要重新打开窗口
//								//否则后面跳转到QQ登录，授权页面时会直接缩小当前浏览器的窗口，而不是打开新窗口
//								var A=window.open("oauth/index.php","TencentLogin",
//										"width=450,height=320,menubar=0,scrollbars=1,
//								resizable=1,status=1,titlebar=0,toolbar=0,location=1");
//							}
						</script>
		        	</div>
		        </div>
		      </form>
		      <div class="text-center">
		      	<a href="<{:U('User/register')}>" class="templatemo-create-new">加入我们 <i class="fa fa-arrow-circle-o-right"></i></a>
				  <a href="<{:U('Admin/index/index')}>">后台</a>
		      </div>
		</div>
	</div>
	<script>
		$(function(){
			var loginform = $('#login-form');
			var username = $('#username');
			var password = $('#password');
			loginform.submit(function(){
				var resUserName = checkRule(username,/^[\u4E00-\u9FA5a-zA-Z0-9_]{3,20}$/);
				if(!resUserName){
					popMSG('用户名格式','用户名含有特殊字符');
					return false;
				}
				var resPassWord = checkRule(password,/^[a-zA-Z]\w{5,17}$/);
				if(!resPassWord){
					popMSG('密码格式','以字母开头，只能包含字符、数字和下划线的6-18个字符');
					return false;
				}
			});

//			popMSG('title','提示信息');


		});
	</script>
</body>
</html>